using Circus.CodeEditor;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Drawing;
namespace Circus.Syntax
{
	[Serializable]
	public class SyntaxAttributes : SortList<SyntaxAttribute>
	{
		public virtual bool PositionChanged(int x, int y, int deltaX, int deltaY)
		{
			bool result = false;
			foreach (SyntaxAttribute current in this)
			{
				Point position = current.Position;
				if (deltaY == 0 && position.Y > y)
				{
					break;
				}
				if (Range.UpdatePos(x, y, deltaX, deltaY, ref position, current.Name == SyntaxConsts.DefinitionScopeEnd))
				{
					current.Position = position;
					result = true;
				}
			}
			return result;
		}
		public virtual bool BlockDeleting(Rectangle rect)
		{
			bool result = false;
			for (int i = base.Count - 1; i >= 0; i--)
			{
				if (SortList<SyntaxAttribute>.InsideRange(base[i].Position, rect))
				{
					base.RemoveAt(i);
					result = true;
				}
			}
			return result;
		}
	
	}
}
